<?php
function not_special($packet)
{
	$replace_pattern = "/&nbsp;/";
	$packet = preg_replace($replace_pattern,"",$packet);
	
	$pattern = "/[a-zA-Z]+/";
	$match_count = preg_match_all($pattern,$packet,$matches);
	
	
	if($match_count)
		return true;
	return false;
}

function get_short_name($packet)
{

	$packet = trim($packet);	

	$replace_pattern = "/&nbsp;/";
	$packet = preg_replace($replace_pattern,"",$packet);	
	
	$replace_pattern = "/[^a-zA-Z\s]*/";
	$packet = preg_replace($replace_pattern,"",$packet);
	
	$packet = strtolower($packet);
	$packet = str_replace(" ","_",$packet);
	
	if(strlen($packet) >= 15)
	{
		$packet = substr($packet,0,15);
	}
	if(substr($packet,0,1) == "_")
	{
		$packet = substr($packet,1,strlen($packet));
	}
	if(substr($packet,-1) == "_")
	{
		$packet = substr($packet,0,strlen($packet)-1);
	}

	return $packet;
	
}
function not_nbsp($packet)
{
	$pattern = '/&nbsp;/';
	$p_matched = preg_match_all($pattern,$packet,$m);

	if(strlen($packet) == ($p_matched*6 ))
	{
		return false;
	}
	return true;
}
function d($arr)
{
	print "<pre>";print_r($arr);print "</pre>";	
}